package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.sms.SmsOperateSendAudioRequest;
import com.cxso.example.request.sms.SmsOperateSendTextRequest;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "短信服务")
public class SmsClient extends Client {

    public SmsClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "文字短信")
    public Result<?> operateSendText(SmsOperateSendTextRequest smsOperateSendTextRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sms/operateSendText", HttpMethod.POST, smsOperateSendTextRequest).toEntity(null);
    }

    @Schema(description = "语音短信")
    public Result<?> operateSendAudio(SmsOperateSendAudioRequest smsOperateSendAudioRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sms/operateSendAudio", HttpMethod.POST, smsOperateSendAudioRequest).toEntity(null);
    }

}
